/*
 * @Description: 
 * @version: 
 * @Author: cy
 * @Date: 2022-04-29 17:23:33
 * @LastEditors: cy
 * @LastEditTime: 2022-04-29 17:31:55
 */
// 去重
var arr = [1,1,2,2];
var arr2 = [...new Set(arr)];
 
// 判断元素是否在集合中
const set = new Set(arr);
const has = set.has(1);

//求交集
const set2 = new Set([2,3]);
const set3 = new Set([...set].filter(item => set2.has(item)));
